{include_file name="Public/header" title="登录历史"}
{$controller_name = {CONTROLLER_NAME}}


<!-- begin #content -->
<div id="content" class="content">

    <!-- begin page-header -->
    <h1 class="page-header">登录历史</h1>
    <!-- end page-header -->

    <!-- begin search -->
    <!-- end search -->

    <!-- begin row -->
    <div class="row">
        <!-- begin col-12 -->
        <div class="col-md-12">
            <!-- begin panel -->
            <div class="panel panel-inverse">
                <div class="panel-body">
                    <div class="dataTables_wrapper  table-responsive">
                        <table id="data-table" class="table table-striped table-bordered">

                            <thead>
                            <tr>
                                <th>登录时间</th>
                                <th>登录IP</th>
                                <th>登录地点</th>
                                <th>登录方式</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach $list as $v}
                            <tr class="odd gradeX">
                                <td>{$v.login_time}</td>
                                <td>{$v.login_ip}</td>
                                <td>{get_ip_address($v.login_ip, 'sina')}</td>
                                <td>{if 1 == $v.login_source}电脑{elseif 2 == $v.login_source}手机{elseif 3 == $v.login_source}微信{else}其他{/if}</td>

                            </tr>
                            {foreachelse}
                                    <tr><td colspan="12">暂无相关信息</td></tr>
                            {/foreach}

                            </tbody>
                        </table>
                        {include_file name="Public/page"}
                    </div>
                </div>
            </div>
            <!-- end panel -->
        </div>
        <!-- end col-12 -->
    </div>
    <!-- end row -->
</div>
<!-- end #content -->

<!--日期、时间选择插件，更多用法参考http://www.bootcss.com/p/bootstrap-datetimepicker/index.htm-->
<script type="text/javascript" src="{STATIC_PLUG}/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="{STATIC_PLUG}/bootstrap-datetimepicker/js/bootstrap-datetimepicker.zh-CN.js"></script>

<script>
    //删除
    $(".js_delete").click(function(){
        var id = $(this).data('id');
        $.post("{U('activity/change')}", { 'id':id }, function(msg){
            if(msg == 'ok'){
                window.location.reload();
            }else{
                alert(msg);
            }
        });
    });

</script>
{include_file name="Public/footer"}